@model IEnumerable<ForumWrapper>
@if (Model.Count() > 0)
{
    Ajax.Dna().Grid(Model)
                       .Columns(cols =>
                       {
                           cols.Bound(m => m.ID).Title("").Width(60).Template(@<text>
    @Community.GetForumIconHtml(item)
    </text>).Width(20);
                           cols.Bound(m => m.Title).Title("Forum").Template(@<text>
    <table style="width: 100%">
        <tr>
            @if (!string.IsNullOrEmpty(item.ImageUrl))
            {
                <td style="width: 120px;">
                    <img src="@Url.Content(item.ImageUrl)" alt="@item.Title" />
                </td>
            }
            <td style="vertical-align: top;">
                <h2 class="d-forums-thread-title">
                    @Html.ActionLink(item.Title, "Threads", "Forum", new { id = item.ID, index = 1, size = 20 }, null)
                    <a style="margin:0px 5px;float: right;" title="Subscribe this forum" href="@Url.Action("Rss", "Forum", new { Area = "Community", id = item.ID })" target="_blank">
                        <img src="@Url.Content("~/Content/Images/rss.png")" alt="" /></a>
                </h2>
                <div style="padding-left: 5px;white-space: normal;">@item.Description</div>
                @if (item.Moderators != null && item.Moderators.Count > 0)
                {
                    <ul class="d-horizontal-list">
                        <li style="color:#cccccc;">@Html.Global("forums", "Moderators") : </li>
                        @foreach (var m in item.Moderators)
                        { 
                            <li>@Html.UserLink(m.UserName)</li>
                        }
                    </ul>
                }
            </td>
        </tr>
    </table>
    </text>);
                           cols.Bound(m => m.ID).Title(Html.Global("forums","Threads")).Template(@<text>
    <div class="d-forums-list-cell">@item.TotalThreads</div>
    </text>).Width(100).TextAlign(System.Web.UI.WebControls.HorizontalAlign.Right);
                           cols.Bound(m => m.ID).Title(Html.Global("forums", "Posts")).Template(@<text>
    <div class="d-forums-list-cell">@item.TotalPosts</div>
    </text>).Width(100).TextAlign(System.Web.UI.WebControls.HorizontalAlign.Right);
                           cols.Bound(m => m.LastPostID).Title(Html.Global("forums","LastPost")).Template(@<text>
    @if (item.LastPost == null)
    {
        <span>-</span>
    }
    else
    {
        Html.RenderPartial("LastPostCell", item.LastPost);
    }
    </text>).Width(135);
                       })
                   .Render();
}
@Html.StartupScripts()
